Replace raw strings with translation calls#286
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add or edit some changed messages
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces hardcoded raw strings throughout the tabcmd codebase with translation calls to support internationalization. The changes prepare the codebase to use translated strings from properties files instead of embedded English text.
Key changes:
- Replace raw strings in Python source files with translation function calls using
_()syntax - Update properties files to include new translation keys for previously hardcoded strings
- Remove unused string constants and replace them with localized references
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tabcmd/locales/en/tabcmd_messages_en.properties | Adds new translation keys and updates existing ones with deprecation notes and platform-specific information |
| tabcmd/locales/en/shared_wg_en.properties | Removes unused permission-related translation entries and retains only necessary role and format strings |
| tabcmd/execution/parent_parser.py | Replaces hardcoded strings array with translation calls for parser configuration |
| tabcmd/execution/global_options.py | Updates argument help text to use translation keys instead of raw strings |
| tabcmd/commands/user/create_users_command.py | Fixes incorrect translation key usage in error handling |
| tabcmd/commands/site/list_command.py | Replaces local string dictionary with translation calls |
| tabcmd/commands/site/delete_site_command.py | Removes hardcoded strings array and uses translation keys |
| tabcmd/commands/datasources_and_workbooks/publish_command.py | Updates command description to use correct translation key |
| tabcmd/commands/datasources_and_workbooks/get_url_command.py | Updates function call to use renamed translation-based function |
| tabcmd/commands/datasources_and_workbooks/export_command.py | Adds import for updated function name |
| tabcmd/commands/datasources_and_workbooks/delete_command.py | Replaces hardcoded strings with translation keys |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bcantoni
requested changes
Aug 1, 2025
Contributor
bcantoni
left a comment
There was a problem hiding this comment.
@jacalata overall this looks good. I added a script (thank you Cursor) to check message ids between source and properties files. It found 23 that are missing so let's add these in this PR. (Just run python bin/i18n/check-strings.py to see the list.)
- cleaned up string ids that either added "tabcmd" as a prefix or took it off as a prefix incorrectly - add back some deleted strings - incorporate check_strings into the localization build and pushed some output into a log file - added docs in Contributing.md and i18n/README
bcantoni
approved these changes
Aug 5, 2025
jacalata
added a commit
that referenced
this pull request
Aug 8, 2025
* All strings are fetched from *.properties files * clean out unused strings * clarify comment * more global_options settings Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tabcmd/locales/en/tabcmd_messages_en.properties Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tabcmd/commands/datasources_and_workbooks/delete_command.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tabcmd/execution/global_options.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tabcmd_messages_en.properties Add or edit some changed messages * Update global_options.py * Update tabcmd/execution/parent_parser.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tabcmd/execution/parent_parser.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tabcmd/locales/en/tabcmd_messages_en.properties Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * format w black * Add script for double-checking messages found in source code vs properties files * Add a "launching" message which was referenced everywhere * document loc process, fix misreferenced string ids - cleaned up string ids that either added "tabcmd" as a prefix or took it off as a prefix incorrectly - add back some deleted strings - incorporate check_strings into the localization build and pushed some output into a log file - added docs in Contributing.md and i18n/README * format --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Brian Cantoni <bcantoni@salesforce.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new string references do not have translations, but those are being done. When they are returned we will simply have to copy them into the existing files.